Skip to content

feat(ui): DH-23183: Event mapping framework for Element plugins - #1396

Open
mofojed wants to merge 10 commits into
deephaven:mainfrom
mofojed:DH-23183-event-plugin-framework
Open

feat(ui): DH-23183: Event mapping framework for Element plugins#1396
mofojed wants to merge 10 commits into
deephaven:mainfrom
mofojed:DH-23183-event-plugin-framework

Conversation

@mofojed

@mofojed mofojed commented Jul 28, 2026

Copy link
Copy Markdown
Member
  • Adds the eventMapping to the ElementPlugin template
  • Adds handling to it to WidgetHandler

mofojed added 8 commits July 24, 2026 11:13
Adds a new ui.notification component that displays a system-level notification via the browser Notifications API. Supports description, icon, tag, silent, on_click, and on_close options. Auto-requests permission and falls back to a toast when notifications are denied or unsupported.
Add a ui.tone API that plays notes, chords, and sequences using the
browser's Web Audio API, synthesized natively from an oscillator so no
audio file is transferred. Supports note names or frequencies, per-note
durations, chords (nested lists), rests (None), waveform selection, and
gain, following the same event-plumbing pattern as ui.notification.

Includes Python and JS unit tests and component docs.
- Update the ElementPlugin to support an eventMapping as well for handling events
@mofojed
mofojed requested review from a team and dsmmcken July 28, 2026 13:45
@mofojed mofojed self-assigned this Jul 28, 2026
@mofojed
mofojed requested review from jnumainville and removed request for a team July 28, 2026 13:45
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@mofojed mofojed left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add something to the docs (and the existing toast docs) about how you must call the emit function from within a deephaven.ui render context.

name: string,
eventMap: ReadonlyMap<string, UIEventHandler> = EMPTY_MAP
): UIEventHandler | null {
return eventHandlerMap[name] ?? eventMap.get(name) ?? null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some collision risk here. We should probably namespace our events + throw warning if there is an eventMap collision rather than just silently override + have a note of that event namespacing in the docs somewhere.

@github-actions
github-actions Bot requested a review from margaretkennedy July 29, 2026 18:06
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

@margaretkennedy margaretkennedy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update to toast.md LGTM

Rename the toast and navigate event names to deephaven.ui.toast and
deephaven.ui.navigate. The JS side defines constants for the legacy
event names and continues to handle them for older servers. The element
plugin template docs now explain the namespacing convention.
@github-actions

Copy link
Copy Markdown

ui docs preview (Available for 14 days)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants